home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_013 / shapes.abc < prev    next >
Text File  |  1992-05-06  |  4KB  |  101 lines

  1. 10    ' ==========================================================
  2. 20    ' Color shaper designer, by Tim Holloway, Jacksonville, FL
  3. 30    ' Allows the design of 16*16 graphics that can be saved
  4. 40    ' as a file and BLOADED into ABasiC programs
  5. 50    '
  6. 60    ' Features: mouse-selectable color registers (0-7)
  7. 70    ' mouse-controllable sliders to program colors
  8. 80    ' mouse used to click on colors in 'fatbits' box
  9. 90    ' HELP KEY!!! (uses windows)
  10. 100   ' ==========================================================
  11. 110   DIM PIXEL%(138): ' Define similar array(s) in programs to BLOAD 
  12. 120   ' and GSHAPE the pictures you generate.
  13. 130   SCNCLR
  14. 140   RGB 5,8,2,15: ' Initial color
  15. 150   GOSUB 630
  16. 160   PRINT AT (1,1) "GRAPHICS EDITOR by Tim Holloway"
  17. 170   PEN=5:pena 5:PENO 5:GOSUB 900
  18. 180   for i=0 to 16:draw (i*8+10, 10;i*8+10,16*8+10),1:next
  19. 190   for i = 0 to 16: draw (10,i*8+10; 10+16*8,i*8+10),1:next
  20. 200   '
  21. 210   get a$
  22. 220   if a$<> "" then 330
  23. 230   ASK MOUSE X%,Y%,C%
  24. 240   ' PRINT AT (1,22);X%;Y%:' DEBUGGING
  25. 250   if c%=0 then 210
  26. 260   if (X%>39) AND (X%<105) AND (y%>152) and (y%<160) then 410
  27. 270   IF (X%>217) AND (X%<281) AND (Y%>150) AND (Y%<180) THEN 720
  28. 280   if (x% < 11) or (x%>137) or (y%<11) or (y%>137) then 210
  29. 290   x%=int((x%-11)/8)+1:y%=int((y%-11)/8)+1
  30. 300   draw (150+x%,50+y%)
  31. 310   box (11+(x%-1)*8,11+(y%-1)*8; 17+(x%-1)*8,17+(y%-1)*8),1
  32. 320   goto 210
  33. 330   '
  34. 340   IF A$ >= "a" AND A$ <= "z" THEN A$=CHR$(ASC(A$)-&H20)
  35. 350   if asc(a$) = 155 then 470
  36. 360   ' You can select a register by typing its number
  37. 370   IF INSTR ("012345678",A$) <> 0 THEN PENA VAL(A$):PENO Val(A$): GOTO 210
  38. 380   IF A$="S" THEN 550
  39. 390   IF A$="E" THEN 40:'ERASE
  40. 400   GOTO 210
  41. 410   ' select color
  42. 420   PEN= int((X%-40)/8)
  43. 430   pena PEN:peno PEN
  44. 440   GOSUB 900
  45. 450   goto 180
  46. 460   '
  47. 470   ' ANALYZE ESCAPE SEQUENCE
  48. 480   getkey a$
  49. 490   getkey b$
  50. 500   if asc(b$) <> 126 then 490
  51. 510   if a$ <> "?" then 530
  52. 520   gosub 820:goto 200
  53. 530   goto 210
  54. 540   '
  55. 550   ' SAVE SHAPE
  56. 560   SSHAPE (150,50; 166,66),PIXEL%()
  57. 570   PRINT AT (19,2) "FILENAME=";
  58. 580   INPUT FI$
  59. 590   IF FI$="" THEN 610
  60. 600   BSAVE FI$+".PIC",VARPTR(PIXEL%(0)),138*4
  61. 610   print at (19,2) "                    ":goto 210
  62. 620   '
  63. 630   ' DRAW COLOR SAMPLE BOXES
  64. 640   FOR I = 0 TO 7
  65. 650   PENA I:PENO I:BOX (40+8*I,160; 48+8*I,168),1
  66. 660   NEXT
  67. 670   PRINT AT (6,23);"01234567"
  68. 680   PRINT AT (22,20) "RED";:DRAW (220,154;284,154)
  69. 690   PRINT AT (22,21) "GREEN";:DRAW (220,162;284,162)
  70. 700   PRINT AT (22,22) "BLUE";:DRAW (220,170;284,170)
  71. 710   RETURN
  72. 720   ' ALTER COLOR REGISTERS
  73. 730   ASK RGB PEN,RED%,GREEN%,BLUE%
  74. 740   NEWC%=INT((X%-220)/4)
  75. 750   IF (Y%>153) AND (Y%<158) THEN RED%=NEWC%:GOTO 790
  76. 760   IF (Y%>161) AND (Y%<169) THEN GREEN%=NEWC%:GOTO 790
  77. 770   IF (Y%>171) THEN BLUE%=NEWC%:GOTO 790
  78. 780   GOTO 210
  79. 790   RGB PEN,RED%,GREEN%,BLUE%
  80. 800   GOSUB 900
  81. 810   GOTO 210
  82. 820   ' Help
  83. 830   window #1,148,11,152,150,"HELP"
  84. 840   cmd #1
  85. 850   print "E - erase and    redraw"
  86. 860   print "S - Save picture as filename.PIC"
  87. 870   print "Control-C to     quit"
  88. 880   print "Use mouse on     sliders to      change colors"
  89. 890   print:print:pint:print:print "press RETURN to    continue":cmd 0:getkey z$:close #1:return
  90. 900   ' PRINT REGISTER VALUES
  91. 910   ASK RGB PEN,RED%,GREEN%,BLUE%
  92. 920   PRINT AT (22,13);"REG ";PEN
  93. 930   PRINT AT (22,14);"RED";RED%
  94. 940   PRINT AT (22,15);"GREEN";GREEN%
  95. 950   PRINT AT (22,16);"BLUE";BLUE%
  96. 960   PENA 0:DRAW (42,150;42+64,150)
  97. 970   PENA 15:DRAW (42+8*PEN,150;46+8*PEN,150)
  98. 980   PENA PEN
  99. 990   RETURN
  100.  
  101.